package chapter7.examples;

public class A {
    public static void main(String[] args) {

    }
    protected int a;
}
class B extends A{
    int getA(){
       return this.a;
    }
    B(){}
}
class Test{
    void test(){
        //A a=new A();
        A a=new B();//上转型
        B b=(B)new A();//下转型
    }
}